#ifndef LOGIN_H
#define LOGIN_H

#include <QWidget>
#include "picturewidget.h"
#include "mainwidget.h"
#include "person.h"
#include "registerwidget.h"

namespace Ui {
class Login;
}

class Login : public QWidget
{
    Q_OBJECT

public:
    explicit Login(QWidget *parent = nullptr);
    ~Login();

    void basicSettings(); //基础设置
    void connectSettings(); //连接设置
    void update(); //刷新界面数据


protected:
    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void keyPressEvent(QKeyEvent * event)override;

private:
    Ui::Login *ui;

    Person * login_user = nullptr; //用户指针
    QPoint address; //鼠标位置
    pictureWidget * rotation; //轮播窗
    QList<QPixmap> pixmapList; //轮播图列表
    MainWidget * mainWindow = nullptr; //主窗口
    registerWidget * registID = nullptr; //注册窗口

public slots:
    void loginJudge();
    void nextLogin();
    void btnRegister_clicked();
    void dealMsg(QNetworkReply *reply); //处理登录接收到的数据
    void dealMsg1(QNetworkReply *reply);  //处理收到的个人信息数据

signals:
    void keyEnter();
};

#endif // LOGIN_H
